
import {componentsFnMap} from '../../config'
const settings = {
    "idPrefix":``,
    "labelName":"按钮组", // 负责显示组件的名称
    "componentNameShow":"按钮组", // 负责显示组件的名称
    "componentName":'yc-btn-container', // 依据在if1.3.js中使用Vue.component注册的具体名称决定,也用作vue中v-for的key值组成
    "btnArr" : [{name:'重置'},{name:'提交'}], // 按钮数组
}
componentsFnMap[settings.componentName] = {
    getHtmlStr (options = {}) {
        let {btnArr = [],boxId = '',focusIndex,formName,formBoxId} = options
        let btnHtmlStr = btnArr.map((item,index) => {
            let {name = '',icon = ''} = item
            let btnId = `${boxId}_btn_${index}`
            let typeStr = name === '提交' ? `type="primary" @click="on${formName}Submit"` : ''
            return `
                            <el-button ${typeStr} focusIndex="${formBoxId}#${'noValid'}" id="${btnId}" >
                                <i class="glyphicon glyphicon-${icon}"></i>
                                ${name}
                            </el-button>        
            `
        }).join('\n')
        return `
        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" id="${boxId}">
          <el-form-item class="form-button-group" >
            <div class="form-button-group-div">
                ${btnHtmlStr}
            </div>
          </el-form-item>
        </el-col>                     
        `
    },
    getScriptStr (options = {}) {
        let scriptStr = ``
        return scriptStr
    }
}
export default settings

/* 
          <el-form-item class="form-button-group">
            <div class="btn-right" style="text-align: 'right'" id="${boxId}">
              <el-button
                style="margin-right: 12px"
                @click="resetForm(formRef)"
              >
                重置
              </el-button>
              <el-button type="primary" @click="onSubmit(formRef)">
                添加
              </el-button>
*/